package com.jxzn.locust.model;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.apache.commons.collections4.CollectionUtils;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.alibaba.excel.annotation.ExcelProperty;
import com.jxzn.locust.support.validator.NormalGroup;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "player")
public class Player extends AbstractNamedModel {
    private static final long serialVersionUID = 1L;

    /** 手机 */
    @NotBlank(groups = NormalGroup.class)
    @ExcelProperty("移动电话")
    String mobile;
    @ExcelProperty("国家区号")
    String countryAreaCode;
    @ExcelProperty("工作单位")
    String workplace;
    @ExcelProperty("邮箱")
    String email;
    @ExcelProperty("国籍")
    String nationality;

    public static void showAll(List<Player> playerList) {
        if (CollectionUtils.isEmpty(playerList)) {
            return;
        }
        playerList.forEach(item -> {
            item.show();
        });
    }

    public void show() {
    }

}
